$(function() {
	
	// 创建表单结构
	var mainform = $("#mainform");
	mainform.ligerForm({
		inputWidth : 280,
		fields : [ 
		          
		          {
		  			display : "test",
		  			name : "ta",
		  			newline : true,
		  			labelWidth : 100,
		  			width : 220,
		  			space : 30,
		  			type : "text"
		  			
		          },
		          {
			  			display : "test22",
			  			name : "tb",
			  			newline : true,
			  			labelWidth : 100,
			  			width : 220,
			  			space : 30,
			  			type : "text"
			  			
			          },
		  			 {
		  				display : "部门",
		  				name : "orgid",
		  				newline : false,
		  				labelWidth : 100,
		  				width : 220,
		  				space : 30,
		  				type : "select",
		  				validate : {
		  					required : true
		  				},
		  				comboboxName : "mbmc_",
		  				options : {
		  					valueFieldID : "orgid",
		  					
		  					data:[{"id":1300496,"text":"部门1"},{"id":34,"text":"部门2"},{"id":35,"text":"部门3"}]
		  				}
		  			 },
		          
		    {
			display : "部门",
			name : "orgid",
			newline : false,
			labelWidth : 100,
			width : 220,
			space : 30,
			type : "select",
			validate : {
				required : true
			},
			comboboxName : "mbmc_",
			options : {
				valueFieldID : "orgid",
				
				data:[{"id":1300496,"text":"部门1"},{"id":34,"text":"部门2"},{"id":35,"text":"部门3"}]
			}
		},
		{
		    display : "教学科目",
			name : "jxkm",
		    newline : true,
		    labelWidth : 100,
		    width : 220,
		    space : 30,
		    type : "select",
		    comboboxName:"myJxkm",
		    readonly :"readonly",
		    options : {
			
		    	data:[{"id":6,"text":"科目1"},{"id":34,"text":"科目2"},{"id":35,"text":"科目3"}],
		    	isShowCheckBox: true, isMultiSelect: true,
		    	valueFieldID: 'jxkm'
		}
		} 
		],
		toJSON : JSON2.stringify
	});

	
	var userdata = {"orgid":"1300496","jxkm":"6;34","ta":"aa","tb":"bbb"};
		LG.loadDataForm(mainform, userdata);
		
		
		var preID = '';
        for (var p in data)
        {
            var ele = $("[name=" + (preID + p) + "]", mainform);
            //针对复选框和单选框 处理
            if (ele.is(":checkbox,:radio"))
            {
                ele[0].checked = data[p] ? true : false;
            }
            else
            {
                ele.val(data[p]);
            }
            ele.css("readonly","readonly");
        }
		
        $("#ta").css("readonly","readonly");
        $("#tb").css("readonly","readonly");
	 $("#mbmc_").css("readonly","readonly");
	 $("#myJxkm").css("readonly","readonly");
		//liger.get("myJxkm").selectValue("6;34");
	


});


